]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
animations: Guard against empty animations
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 21 Nov 2016 17:09:42 +0000 (18:09 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 22 Nov 2016 17:38:10 +0000 (18:38 +0100)
Our animation code not only relies on the animation being loaded
(which we handle), but also on having at least one frame - otherwise
the computation of the next frame index will turn up NaN through
division by zero. Guard against this case by treating empty animations
as not loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=774805

js/ui/animation.js

index 23ec934d8c9ca9e400cc2c4b670524ec29c160a9..1ae9ba0eab5d85ba3f1bccce7f34f7f3117d17d4 100644 (file)
@@ -67,7 +67,7 @@ const Animation = new Lang.Class({
     },
 
     _animationsLoaded: function() {
-        this._isLoaded = true;
+        this._isLoaded = this._animations.get_n_children() > 0;
 
         if (this._isPlaying)
             this.play();